import { createStore } from 'vuex'

export default createStore({
  state: {
    userInfo: {}
  },
  mutations: {
    setUserInfo(state, payload) {
      state.userInfo = payload;
      localStorage.setItem("ts_userInfo", JSON.stringify(payload));
    },
    clearUserInfo(state) {
      state.userInfo = {};
      localStorage.setItem("ts_userInfo", "");
    }
  }
})
